import { $http } from "@/utils/Request/index.js";
import { ref } from "vue";

export const useTopBar = async (leftBarList, leftBarCurrent) => {
  const API_getCategorySubList = (categoryId) => {
    return $http.request({
      url: "goods/getCategorySubList",
      method: "POST",
      data: {
        categoryId,
      },
    });
  };
  let topBarList = ref([]);
  topBarList.value = await API_getCategorySubList(
    leftBarList.value[leftBarCurrent].id
  );
  return {
    topBarList,
  };
};
